C1.LiveLinq.Collections Namespace > IndexedCollection<T> Class : BeginUpdate Method |
This method must be followed by EndUpdate.
Use this method when you already have indexes built over the IndexedCollection<T> or live views based on it, and you need to re-populate this IndexedCollection<T> or perform other massive changes to items of this collection. Without this method, every single change you make causes LiveLinq to perform necessary operations for maintaining your indexes and live views dependent on this collection. In case of massive changes, this can be slower than to wait until the massive changes are done and rebuild the indexes and live views.
Between BeginUpdate and EndUpdate calls, indexes, live views, bound controls and other change notification listeners are not updated, they don't receive change notifications.
When EndUpdate is called, a SourceChangeType.Modify or SourceChangeType.Reset notification is sent, depending on whether the change affected a single item or multiple items of the collection. Even when you change a single item, it may make sense to enclose your changes in BeginUpdate/EndUpdate if you change multiple properties of the item. In that case a SourceChangeType.Modify notification is sent. If more than one item was changed, a SourceChangeType.Reset notification is sent, meaning all indexes, live views and other collections dependent on this data table must be rebuilt from scratch.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2